Chrome/Safari ignore Content-Disposition filename on save if disposition type is inline #25456
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding a note about behavior that deviates in Chrome in the following condition:
Content-Disposition: inline; filename="something"
background:
Usually, the
filename
parameter is used to prefill the file name forattachment
types -> this triggers a save-as dialog immediately on navigation:Content-Disposition: attachment; filename=example.html
inline
means the user agent is supposed to render the document "as usual" instead of prompting the user to download. In this case, adding a filename is allowed for cases where the user saves the document at a later stage. I've added some more details in the linked issue.actual behavior:
Chrome uses the document title (PDF / HTML) instead of the
filename
parameter, which may be unexpected for some developers.Test results and supporting details
It's visible in the linked BCD issue and there are multiple reproducers in the Chrome bug.
Related issues
Fixes #18108